/**
 * @Project : ProgrammingExercises
 * @Package : Leetcode
 * @File : Q2496.java
 * @Author : WangRuoyu
 * @Date 2022/12/17 21:17
 */

package leetcode;

public class Q2496 {
    static boolean isAllNumber(String str) {
        for (int i = 0; i < str.length(); i++) {
            if ((str.charAt(i) - 'A') > 0) {
                return false;
            }
        }
        return true;
    }

    public int maximumValue(String[] strs) {
        int res = 0;
        for (String str : strs) {
            if (isAllNumber(str)) {
                res = Math.max(res, Integer.parseInt(str));
            } else {
                res = Math.max(res, str.length());
            }
        }
        return res;
    }

    public static void main(String[] args) {
        Q2496 sl = new Q2496();
        String[] strs = {"alic3", "bob", "3", "4", "00000"};
        System.out.println(sl.maximumValue(strs));
    }
}
